﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CinemaMaestro.ViewModels
{
    public class CinemaViewModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string TelephoneNr { get; set; }

        public static implicit operator CinemaViewModel(Cinema cinema)
        {
            return new CinemaViewModel
            {
                Id = cinema.Id,
                Name = cinema.Name,
                Address = cinema.Address,
                TelephoneNr = cinema.TelephoneNr
            };
        }

        public static implicit operator Cinema(CinemaViewModel cinemaVM)
        {
            return new Cinema
            {
                Id = cinemaVM.Id,
                Name = cinemaVM.Name,
                Address = cinemaVM.Address,
                TelephoneNr = cinemaVM.TelephoneNr
            };
        }

        public override string ToString()
        {
            return Name;
        }
    }
}
